<template>
<div>
  <el-tree
      :data="data"
      show-checkbox
      node-key="id"
      :default-expanded-keys="[2, 3]"
      :default-checked-keys="[]"
      @check-change="getChecked"
      :props="defaultProps">
  </el-tree>

</div>
</template>

<script>
export default {
  name: "TreeView",
 data() {
    return {
        data:[],
      defaultProps: {
        children: 'subMenuList',
        label: 'name'
      }
    }
  },methods:{
    getChecked(p1,p2,p3){
      console.log(p1.name)

    }
  }
  ,created() {
    this.axios.get(this.$baseUrl+'menu/testTree').then(res=>{
       this.data= res.data.data;
    })
  }
}
</script>

<style scoped>

</style>